home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 March / maximum-cd-2000-03.iso / Quake3 Game Source / Q3AGameSource.exe / Main / be_ai_goal.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-18  |  3.5 KB  |  96 lines

  1. // Copyright (C) 1999-2000 Id Software, Inc.
  2. //
  3. /*****************************************************************************
  4.  * name:        be_ai_goal.h
  5.  *
  6.  * desc:        goal AI
  7.  *
  8.  * $Archive: /source/code/botlib/be_ai_goal.h $
  9.  * $Author: Mrelusive $ 
  10.  * $Revision: 2 $
  11.  * $Modtime: 10/05/99 3:32p $
  12.  * $Date: 10/05/99 3:42p $
  13.  *
  14.  *****************************************************************************/
  15.  
  16. #define MAX_AVOIDGOALS            64
  17. #define MAX_GOALSTACK            8
  18.  
  19. #define GFL_NONE                0
  20. #define GFL_ITEM                1
  21. #define GFL_ROAM                2
  22. #define GFL_DROPPED                4
  23.  
  24. //a bot goal
  25. typedef struct bot_goal_s
  26. {
  27.     vec3_t origin;                //origin of the goal
  28.     int areanum;                //area number of the goal
  29.     vec3_t mins, maxs;            //mins and maxs of the goal
  30.     int entitynum;                //number of the goal entity
  31.     int number;                    //goal number
  32.     int flags;                    //goal flags
  33.     int iteminfo;                //item information
  34. } bot_goal_t;
  35.  
  36. //reset the whole goal state, but keep the item weights
  37. void BotResetGoalState(int goalstate);
  38. //reset avoid goals
  39. void BotResetAvoidGoals(int goalstate);
  40. //remove the goal with the given number from the avoid goals
  41. void BotRemoveFromAvoidGoals(int goalstate, int number);
  42. //push a goal
  43. void BotPushGoal(int goalstate, bot_goal_t *goal);
  44. //pop a goal
  45. void BotPopGoal(int goalstate);
  46. //makes the bot's goal stack empty
  47. void BotEmptyGoalStack(int goalstate);
  48. //dump the avoid goals
  49. void BotDumpAvoidGoals(int goalstate);
  50. //dump the goal stack
  51. void BotDumpGoalStack(int goalstate);
  52. //name of the goal
  53. void BotGoalName(int number, char *name, int size);
  54. //get goal from top of stack
  55. int BotGetTopGoal(int goalstate, bot_goal_t *goal);
  56. int BotGetSecondGoal(int goalstate, bot_goal_t *goal);
  57. //choose the best long term goal item for the bot
  58. int BotChooseLTGItem(int goalstate, vec3_t origin, int *inventory, int travelflags);
  59. //choose the best nearby goal item for the bot
  60. int BotChooseNBGItem(int goalstate, vec3_t origin, int *inventory, int travelflags,
  61.                             bot_goal_t *ltg, float maxtime);
  62. //returns true if the bot touches the goal
  63. int BotTouchingGoal(vec3_t origin, bot_goal_t *goal);
  64. //returns true if the goal should be visible but isn't
  65. int BotItemGoalInVisButNotVisible(int viewer, vec3_t eye, vec3_t viewangles, bot_goal_t *goal);
  66. //get some info about a level item
  67. int BotGetLevelItemGoal(int index, char *classname, bot_goal_t *goal);
  68. //get the next camp spot in the map
  69. int BotGetNextCampSpotGoal(int num, bot_goal_t *goal);
  70. //get the map location with the given name
  71. int BotGetMapLocationGoal(char *name, bot_goal_t *goal);
  72. //returns the avoid goal time
  73. float BotAvoidGoalTime(int goalstate, int number);
  74. //initializes the items in the level
  75. void BotInitLevelItems(void);
  76. //regularly update dynamic entity items (dropped weapons, flags etc.)
  77. void BotUpdateEntityItems(void);
  78. //interbreed the goal fuzzy logic
  79. void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child);
  80. //save the goal fuzzy logic to disk
  81. void BotSaveGoalFuzzyLogic(int goalstate, char *filename);
  82. //mutate the goal fuzzy logic
  83. void BotMutateGoalFuzzyLogic(int goalstate, float range);
  84. //loads item weights for the bot
  85. int BotLoadItemWeights(int goalstate, char *filename);
  86. //frees the item weights of the bot
  87. void BotFreeItemWeights(int goalstate);
  88. //returns the handle of a newly allocated goal state
  89. int BotAllocGoalState(int client);
  90. //free the given goal state
  91. void BotFreeGoalState(int handle);
  92. //setup the goal AI
  93. int BotSetupGoalAI(void);
  94. //shut down the goal AI
  95. void BotShutdownGoalAI(void);
  96.